package iterator;

public class Test {
    public static void main(String[] args) {
        BookShelf bf=new BookShelf();
        bf.appendBook(new Book("金瓶梅"));
        bf.appendBook(new Book("西游记"));
        bf.appendBook(new Book("三国"));
        bf.appendBook(new Book("水浒"));
        bf.appendBook(new Book("红楼"));
       Iterator it=bf.iterator();
       while (it.hasNext()){
           Book book =(Book) it.next();
           System.out.println(book.getName());
       }
    }
}
